package chances.system.operator.repo;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import chances.system.operator.entity.Role;

public interface RoleRepository extends JpaRepository<Role,Long> {
	
	@Query("select r from Role r where r.name like %:name%") 
	public List<Role> findByNameLike(@Param("name")String name);
	
	@Query("select o from Role o") 
	public Page<Role> search(@Param("name")String name, Pageable pageable);

}
